package com.zbmsg.user.service;

import com.zbmsg.user.bean.User;

import io.netty.channel.Channel;

public interface IUserService {
	
	/**
	 * 添加用户
	 * @param channel
	 * @param name
	 * @return
	 */
	public User add(String name) throws Exception;
	
	/**
	 * 设置连接和用户关系
	 * @param userId
	 * @param channel
	 * @return
	 * @throws Exception
	 */
	public User setChannel(String userId,Channel channel) throws Exception;
	
	/**
	 * 清除用户
	 * @param userId
	 */
	public void remove(String userId) throws Exception;
	
	/**
	 * 根据channel查询user
	 * @param channel
	 * @return
	 * @throws Exception
	 */
	public User getUserByChannel(Channel channel) throws Exception;
	
	/**
	 * 更新用户信息
	 * @param user
	 * @return
	 * @throws Exception
	 */
	public User updateUser(User user) throws Exception;
	
	/**
	 * 获取用户信息
	 * @param user
	 * @return
	 * @throws Exception
	 */
	public User getUserByUserId(String userId) throws Exception;
}
